class AsyncPlugin {
  apply (compiler) {
    compiler.hooks.emit.tapAsync('AsyncPlugin', function (states, cb) {
      setTimeout(() => {
        console.log('等一下。')
        cb()
      }, 1000)
    })
    compiler.hooks.emit.tapPromise('AsyncPlugin', function (states, cb) {
      return new Promise((resolve => {
        setTimeout(() => {
          console.log('zai 等一下。')
          resolve()
        }, 1000)
      }))

    })
  }
}

module.exports = AsyncPlugin
